import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-03-25
 * Time: 14:45
 */
public class test1 {
    public static void main(String[] args) {
        Scanner q = new Scanner(System.in);
        while (q.hasNext()) {
            String a = q.nextLine();
            String b = q.nextLine();
            int m = 0;
            for (int i = 0; i < a.length() + 1; i++) {
                String str = a.substring(0, i) + b + a.substring(i, a.length());
                StringBuffer str1 = new StringBuffer(str);
                str1.reverse();
                if(str1.toString().equals(str)){
                    m++;
                }
            }
            System.out.println(m);
        }
    }
}
